#ifndef _ALG_BHT_HPP_
#define _ALG_BHT_HPP_
/*----------Tree workshop--------------------*/  
void DrawGrid(PTNode node);										//some bugs left, grid goes to infinity
void DestroyAll(gen_environ * gen_struct);						//(+-)Clear all mmemory in case of external exit
void InitGenInfo(gen_environ ** gen_struct, int nParticles);			//init all data(+-)
void InitNode(PTNode parent_node, PTNode * child_node, int type);		//Create one tree node (-+)
bool IsInsideNode(CPoint position, PTNode node);				//(+)checking for point inside tree node(3D)
PTNode GetNode(PTNode node, CBody particle);					//(+)search in subnodes (3D)
void InsertParticle(PTNode node, CBody * list, int id);			//(+)Insert recursevly particle to the tree (3D)
void DestroyTree(PTNode root);									//(+)free allocated memory (3D)
void BuildTree(gen_environ * gen_struct);						//(+)Main Function to build tree (3D)
PTNode GetNode(PTNode node, CBody particle);					//(+)Get the subnode (3D)
/*----------Numerical workshop-------------*/
void EvaluateTreeForces(PTNode node, CBody * list, int body_id, gen_environ * gen_struct);	//(+) calculate over the tree for target particle
void CalculateForces(gen_environ * gen_struct);					//(+) run all over the particles(simple function)
void ComputeMassDistribuion(PTNode node, CBody * list);			//(+) recursively find center_mass of all nodes
void MoveBodies(CBody * list, gen_environ * gen_struct);		//(+)Euler method
#endif
